﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace JKZP
{
    public partial class Form_DPSDKWFDD : Form
    {
        public string camid;
        public string wfdddm;

        public Form_DPSDKWFDD()
        {
            InitializeComponent();
        }

        private void Form_DPSDKWFDD_Load(object sender, EventArgs e)
        {
            this.label_camid.Text = camid;
            this.textBox_wfdd.Text = wfdddm;
        }

        private void button_save_Click(object sender, EventArgs e)
        {
            try
            {
                if ((camid != "") && ((textBox_wfdd.Text.Length == 9) || (textBox_wfdd.Text.Length == 12)))
                {
                    bool flag = PP.kdws.JKZP_AddOrEditDPSDKWFDD(camid, textBox_wfdd.Text);
                    if (flag == true)
                    {
                        PP.gDPSDK_WFDD[camid] = textBox_wfdd.Text;
                        this.toolStripStatusLabel1.Text = "保存成功";
                    }
                    else
                    {
                        this.toolStripStatusLabel1.Text = "保存失败";
                    }
                }
                else
                {
                    this.toolStripStatusLabel1.Text = "地点代码长度不正确";
                }
            }
            catch (Exception er)
            {
                this.toolStripStatusLabel1.Text = "保存地点代码异常er=" + er.Message;
            }
        }

        private void button_exit_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
